/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.basic.safe.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hopes.bizz.basic.common.constant.enums.ParkBasicSysDictEnum;
import com.hopes.boss.act.base.EnableFlowSearch;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.common.entity.BaseLogicEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 项目三同时管理
 *
 * @author pig
 * @date 2023-10-30 09:59:17
 */
@Data
@TableName("base_three_meantime")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "项目三同时管理")
public class BaseThreeMeantimeEntity extends BaseLogicEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 标识
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "标识")
    private Long id;

    /**
     * 机构ID
     */
    @Schema(description = "机构ID")
    @EnableFlowSearch()
    private Long orgId;

    /**
     * 项目名称
     */
    @Schema(description = "项目名称")
    @EnableFlowSearch(fuzzyQuery = true)
    private String projectName;

    /**
     * 项目编号
     */
    @Schema(description = "项目编号")
    private String projectCode;

    /**
     * 项目负责人
     */
    @Schema(description = "项目负责人")
    private String projectPrincipal;

    /**
     * 项目类别
     */
    @Schema(description = "项目类别")
    @EnableFlowSearch()
    private String projectType;

    /**
     * 总投资
     */
    @Schema(description = "总投资")
    private Double projectInvest;

    /**
     * 建设日期
     */
    @Schema(description = "建设日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date constructDate;

    /**
     * 截止日期
     */
    @Schema(description = "截止日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date completeDate;

    /**
     * 建设单位
     */
    @Schema(description = "建设单位")
    private String constructUnit;

    /**
     * 建设地点
     */
    @Schema(description = "建设地点")
    private String constructAddr;

    /**
     * 建设范围
     */
    @Schema(description = "建设范围")
    private String constructScope;

    /**
     * 项目状态  1:填报中 2:审核中 3:审核通过 4:审核不通过 5:进行中 6:竣工验收 7:归档
     */
    @Schema(description = "项目状态  1:填报中 2:审核中 3:审核通过 4:审核不通过 5:进行中 6:竣工验收 7:归档")
    private String projectStatus;

    /**
     * 项目进度
     */
    @Schema(description = "项目进度")
    private String planStatus;

    /**
     * 项目描述
     */
    @Schema(description = "项目描述")
    private String projectDesc;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;

    /**
     * 附件
     */
    @Schema(description = "附件")
    private String attachment;


    public String getProjectTypeStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.project_type, this.projectType);

    }

    public String getProjectStatusStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.audit_status, this.projectStatus);

    }

    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.orgId);

    }

    public String getPlanStatusStr() {
        return DictResolver.getItemLabelByValue(ParkBasicSysDictEnum.project_plan, this.planStatus);

    }

}
